import request from '../config/request'

export default{
  wxLogin(wechatUser){
    return request.post({
      url: "/user/wxLogin",
      data: wechatUser,
      ignoreToken: true,
      form: false
    })
  },
  updateOwn(newUser){
    return request.put({
      url: "/user/updateUser",
      data: newUser,
      ignoreToken: false,
      form: false
    })
  },
  bindEmail(params) {
    return request.put({
      url: "/user/bindMail"+"?email="+params.email+"&code="+params.code,

      ignoreToken: false,
      form: false
    })
  },
  getCode(email) {
    return request.get({
      url: "/user/getCode",
      data: {email},
      ignoreToken: false,
      form: true
    })
  },
  editPassword(data) {
    return request.put({
      url: "/user/editPassword",
      data,
      ignoreToken: false,
      form: true
    })
  }
}
